<template>
  <div 
    class="data-card slide-in-up"
    :class="{ 'glow-border': glowEffect, 'loading': loading }"
    :style="{ animationDelay: `${animationDelay}ms` }"
  >
    <div class="card-header">
      <div class="card-title">
        <span v-if="icon" class="card-icon">{{ icon }}</span>
        <h3>{{ title }}</h3>
      </div>
      <slot name="header-actions" />
    </div>
    
    <div class="card-body">
      <slot v-if="!loading" />
      <LoadingAnimation v-else />
    </div>
    
    <div v-if="$slots.footer" class="card-footer">
      <slot name="footer" />
    </div>
  </div>
</template>

<script setup lang="ts">
import type { DataCardProps } from '@/types'
import LoadingAnimation from './LoadingAnimation.vue'

withDefaults(defineProps<DataCardProps>(), {
  loading: false,
  glowEffect: false,
  animationDelay: 0
})
</script>

<style lang="scss" scoped>
.data-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  
  &:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 243, 255, 0.2);
  }
  
  &.loading {
    opacity: 0.7;
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  
  h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--color-primary);
  }
}

.card-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px var(--color-primary));
}

.card-body {
  min-height: 100px;
}

.card-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  color: var(--text-secondary);
}
</style>
